﻿using System;
using System.Collections.Generic;
using UnityEngine;

public class MoveAction :MonoBehaviour,IMove
{
	/// <summary>
	/// 角色状态
	/// </summary>
	private string _status;
	private Vector3 _vPosition;
	protected int _direction;

	/// <summary>
	/// 模型
	/// </summary>
	protected ClipAnimation _playerAnimation;
    
	public ClipAnimation playerAnimation {
		get { return _playerAnimation;}
	}

	/// <summary>
	/// 角色方向1:右，-1:左
	/// </summary>
	public int direction {
		get { return _direction; }
		set { _direction = value; }
	}
	
	/// <summary>
	/// 改变角色状态
	/// </summary>
	public string status {
		get { return _status; }
		set { 
			_status = value;
			updataStatus (_status);
		}
	}
	
	/// <summary>
	/// 更新模型动作
	/// </summary>
	protected void updataStatus (string state)
	{
		_playerAnimation.Play (state);
	}
	
	/// <summary>
	/// 移动到的坐标
	/// </summary>
	public void move (Vector2 target)
	{
		
	}

	/// <summary>
	/// 三维坐标,z用于显示排序
	/// </summary>
	public Vector3 vPosition {
		get { return _vPosition; }
		set {
			_playerAnimation.transform.position = value; 
		}
	}
}